<?php
/**
* This class is used when you need to insert pure html text.
* The __toString method only outputs <code>$htmlText</code>
* It extends from element to can be serialized
*/
class PureHtml extends element
{
    /**
    * Construct of pureHtml class.
    * @param $htmlText string is the pure html text
    * @param @label can be a string or other object (that has __toString method and extends from element)
    */
    public function pureHtml($htmlText=NULL, $label=NULL)
    {
        parent::element(null, null,$label);
        $this->htmlText = $htmlText;
    }

    /**
    * Set the pure html text.
    * @param $htmlText set the pure html text.
    */
    public function setText($htmlText)
    {
        $this->addAttribute('htmlText', $htmlText);
    }

    /**
    * Add an text to html text in element
    * @param the text to be inserted
    */
    public function addText($htmlText)
    {
        $temp = $this->htmlText;
        $this->addAttribute('htmlText', $temp.$htmlText);
    }

    /**
    * Return the pure Html text, in this case, is the same that __toString
    * @return the pure html text
    */
    public function getText()
    {
        return $this->htmlText;
    }

    /**
    * This __toString only outputs $htmlText.
    * @return the pure html text
    */
    public function __toString()
    {
        return $this->htmlText;
    }
}
?>